<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="crm.model.Employees"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="crm.model.all_sum"%>
<%@page import="crm.control.AllSumControl"%>
<%@page import="crm.control.WeeksumControl"%>
<%@page import="crm.model.all_plan"%>
<%@page import="crm.control.AllPlanControl"%>
<%@page import="crm.control.WeekplanControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%
           request.setCharacterEncoding("UTF-8");
           Employees cu = (Employees)session.getAttribute("user");
           String start_time = ParamUtil.getString(request,"start_time");
           String end_time = ParamUtil.getString(request,"end_time");
           int emp_id = cu.getId();
           

 %>
<body>
<%
           all_plan ap = new all_plan();
           ap.setStart_time(start_time);
           ap.setEnd_time(end_time);
           ap.setEmp_id(emp_id);
           
           
           if(AllPlanControl.addAllPlan(ap)){
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
           WeekplanControl.addWeekplan(AllPlanControl.getRushAllPlanId(),emp_id);
         
 %>
 <script type="text/javascript">
           window.alert("创建成功！请继续录入详细信息")
           window.top.location.href="all_plan.jsp";
 </script>
 <%}else{%>
 <script>
          window.alert("创建失败!")
          window.top.location.href="all_plan.jsp";
 </script>
 <%} %>
</body>
</html>